package com.hongpu.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hongpu.domain.CoolTowerEmployeeSalaryProjectRelationship;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * @author Michael zhang
 * @description 针对表【cool_tower_employee_salary_project_relationship(冷却塔安装人员薪资与安装项目关联关系)】的数据库操作Service
 * @createDate 2025-06-12 08:52:59
 */
public interface CoolTowerEmployeeSalaryProjectRelationshipService extends IService<CoolTowerEmployeeSalaryProjectRelationship> {
    /**
     * 根据人员ID查询所在的项目列表
     */
    public IPage<CoolTowerEmployeeSalaryProjectRelationship> selectPage(IPage ipage, Long employeeId);

    /**
     * 获取当前项目的基本工资
     */
    public BigDecimal selectSalary(Long coolTowerProjectId, Long coolTowerEmployeeId);

    /**
     * 从数据库中获取两个日期夸几个月
     */
    public int selectMonth(String startDate, String endDate);

    /**
     * 根据人员ID和项目ID查询数据库中是否已经存在数据
     */
    public boolean  isExistData(@Param("coolTowerEmployeeId") Long coolTowerEmployeeId, @Param("coolTowerProjectId") Long coolTowerProjectId);


    /**
     * 向  cool_tower_employee_salary_project_relationship 表中插入一条数据
     *
     * @param coolTowerEmployeeId 员工ID
     * @param salary              薪资，取值于人员信息表
     * @param dailySettlementFee  日结费用，取值于人员信息表
     * @param subsidy             补助，数据来自cool_tower_employee（保留字段）
     * @param coolTowerProjectId  项目ID
     * @return
     */
    public int insert(Long coolTowerEmployeeId, BigDecimal salary, BigDecimal dailySettlementFee, BigDecimal subsidy, Long coolTowerProjectId);

    /**
     * 从cool_tower_employee_salary_project_relationship 表中获取员工在项目上的工数及各种费用
     */
    public CoolTowerEmployeeSalaryProjectRelationship selectEmployeeSalaryProjectRelationship( Long coolTowerEmployeeId,  Long coolTowerProjectId);
}
